/* MACHINE-GENERATED ! */

frame pad {
	__0: vec @(col*e-Px/2, row*-e-Py/2)
	__1: vec .(0mm, Py)
	__2: vec __0(Px, 0mm)
	rpad "$rname$cname" __1 .
}

frame pads {
	table
	    { ?row, rname }
	    { 0, "A" }
	    { 1, "B" }
	    { 2, "C" }
	    { 3, "D" }
	    { 4, "E" }
	    { 5, "F" }
	    { 6, "G" }
	    { 7, "H" }
	    { 8, "J" }
	    { 9, "K" }
	    { 10, "L" }
	    { 11, "M" }
	    { 12, "N" }
	    { 13, "P" }
	    { 14, "R" }
	    { 15, "T" }
	    { 16, "U" }
	    { 17, "V" }
	    { 18, "W" }
	    { 19, "Y" }
	    { 20, "AA" }
	    { 21, "AB" }

	set cname = col+1

	loop row = 0, Nr-1

	loop col = 0, Nc-1

	frame pad @
}

frame outline {
	__0: vec @(D1/2, -E1/2)
	__1: vec .(D/2, E/2)
	__2: vec __0(-D/2, -E/2)
	rect __1 . 5mil
	__3: vec @(0mm, (E-E1)/2)
	__4: vec @(-(D-D1)/2, 0mm)
	line __3 . 5mil
}

package "BGA-$pins"
unit mm

table
    { pins, Nr, Nc, Px, Py, e, D1, E1, D, E }
    { 6, 3, 2, 0.267mm, 0.267mm, 0.4mm, e, e*(Nr-1), 0.905mm, 1.385mm }
    { 8, 4, 2, 0.23mm, Px, 0.5mm, e, e*(Nr-1), 0.93mm, 1.93mm }
    { 256, 16, 16, 0.5mm, 0.5mm, 1mm, 15mm, D1, 17mm, D }
    { 484, 22, 22, 0.6mm, 0.6mm, 1mm, 21mm, D1, 23mm, D }
    { 324, 18, 18, 0.45mm, 0.45mm, 0.8mm, 13.6mm, D1, 15mm, D }

frame outline @
frame pads @
measy pad.__0 -> pad.__1 1mm
measy pad.__0 -> pad.__0 1.5mm
measx pad.__0 -> pad.__2 -1mm
measx pad.__0 -> pad.__0 -1.5mm
measy pad.__0 >> pad.__1 2.4mm
measx pad.__0 >> pad.__2 -2.4mm
measy outline.__2 >> outline.__1 2.5mm
measx outline.__2 >> outline.__1 -2.5mm
measx pad.__0 >> pad.__0 -1.8mm
measy pad.__0 >> pad.__0 1.7mm
